package com.ysd.lis.controller;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkCalcItem;
import com.ysd.lis.service.WkCalcItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 绩效考核-核算项目表 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-04-16
 */
@RestController
@RequestMapping("/wk/calc/item")
public class WkCalcItemController extends BaseController {

    @Autowired
    WkCalcItemService wkCalcItemService;

    @GetMapping("/getCalcItemList")
    public Result getCalcItemList(@RequestParam(value = "keyWord", required = false) String keyWord) {
        return wkCalcItemService.getCalcItemList(keyWord);
    }

    @PostMapping("/addCalcItem")
    public Result addCalcItem(@RequestBody WkCalcItem wkCalcItem) {
        return wkCalcItemService.addCalcItem(wkCalcItem);
    }

    @PostMapping("/editCalcItem")
    public Result editCalcItem(@RequestBody WkCalcItem wkCalcItem) {
        return wkCalcItemService.editCalcItem(wkCalcItem);
    }

    @PostMapping("/deleteCalcItem")
    public Result deleteCalcItem(@RequestBody List<String> ids) {
        return wkCalcItemService.deleteCalcItem(ids);
    }
}
